package com.coolgor.xutil.SQL;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

public interface DataOperation {
	
	//在数据库连接池中获取连接。
	public Connection getConnection() throws SQLException, InterruptedException;
	//用于执行一个非select的SQL语句，用String SQL直接传入。
	public boolean update(String sql) throws SQLException, InterruptedException;
	//用于执行一组非select的SQL语句，将SQL组装入Vector中，全部执行成功后才commit。
	public boolean executeBatch(java.util.Vector v) throws InterruptedException, SQLException;
	//执行一个select语句，返回一个ResultSet.
	public ResultSet select(String sql) throws SQLException, InterruptedException;
	//执行一个select语句，返回一个CachedRowSetImpl.
	//public CachedRowSetImpl executeCRS(String sql) throws SQLException;
	//获取一个表的结构
	public boolean desc(String tablename) throws SQLException, InterruptedException;
	//判断某一个表是否存在
	public boolean hasTable(String tableName) throws SQLException, InterruptedException;
	//释放资源
	public boolean release();
}
